package com.cab.service;

import com.cab.dao.CabDao;
import com.cab.entity.Cab;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Scope("prototype")
public class CabServiceList implements CabService {
    @Autowired
    private CabDao cabDao = null;
    @Transactional
    public boolean add(Cab cab) {
        boolean flag = cabDao.add(cab);
        return flag;
    }
    @Transactional
    public boolean update(Cab cab) {
        boolean flag = cabDao.update(cab);
        return flag;
    }
    @Transactional
    public boolean delete(Cab cab) {
        boolean flag = cabDao.delete(cab);
        return flag;
    }
    @Transactional
    public List<Cab> select(Cab cab) {
        List<Cab> cabList = cabDao.select(cab);
        return cabList;
    }
    @Transactional
    public Cab selectOne(Cab cab) {
        Cab cab1 = cabDao.selectOne(cab);
        return cab1;
    }
}
